<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <h1>The Goods List Page</h1>
    <a th:href="@{/goods/doGoodsAddUI}">添加商品</a>
    <table>
        <thead>
        <tr>
            <th>id</th>
            <th>name</th>
            <th>remark</th>
            <th>createdTime</th>
            <th colspan="2">operation</th>
        </tr>
        </thead>
        <tbody>
        <!--th:each 为thymeleaf中定义的循环属性,用于迭代集合元素
            ${}为thymeleaf中的el表达式，用于从指定作用域获取数据，
            th:text为thymeleaf中一个向元素内部插入文本的一个特有属性-->
        <tr th:each="good: ${goodsList}">
            <td th:text="${good.id}">1</td>
            <td th:text="${good.name}">MySQL</td>
            <td th:text="${good.remark}">RDBMS...</td>
            <td th:text="${#dates.format(good.createdTime, 'yyyy/MM/dd HH:mm')}">2020/10/09</td>
            <td><a th:href="@{/goods/doDeleteById/{id}(id=${good.id})}">delete</a></td>
            <td><a th:href="@{/goods/doFindById/{id}(id=${good.id})}">update</a></td>
        </tr>
        </tbody>
    </table>

</div>

</body>
</html>